nth term of a linear sequence